package es.mahulo.battleship.mocks;

import es.mahulo.battleship.api.dao.UserDao;
import es.mahulo.battleship.model.Player;
import es.mahulo.battleship.model.User;

public class UserDaoMock implements UserDao {
	
	private User user1;
	private User user2;
	
	public UserDaoMock() {
		user1 = new User();
		user1.setId(1L);
		user1.setName("manuel");
		user1.setPassword("manuel");
		
		user2 = new User();
		user2.setId(2L);
		user2.setName("maeve");
		user2.setPassword("maeve");
	}

	@Override
	public User find(Long id) {
		if (id.longValue() == 1)
			return user1;
		else 
			return user2;
	}

	@Override
	public User findByName(String name) {
		if (name.equals("maeve")) {
			return user2;
		} else {
			return user1;
		}
	}

}
